package com.holyant.goods.dto;

import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.domain.BaseDto;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * 商品供应商对应信息dto
 */
@Data
@ApiModel("商品供应商对应信息")
public class GdsGoodsSupplierImportDto extends BaseDto {
    private static final long serialVersionUID = 1L;

    /** 商品名 */
    @Excel(name = "*供应商名称")
    @NotEmpty(message = "供应商名称不能为空")
    private String supplierName;

    /** 商品名 */
    @Excel(name = "商品名称")
    private String goodsName;

    /** 商品条码 */
    @Excel(name = "*商品条码")
    @NotEmpty(message = "商品条码不能为空")
    private String goodsBarcode;

    /**
     * 交货周期
     */
    @Excel(name = "*交货周期", prompt = "请填写正整数", cellType = Excel.ColumnType.NUMERIC)
    @NotNull(message = "交货周期不能为空")
    private BigDecimal deliveryCycle;
    /**
     * 交货方式
     */
    @Excel(name = "*交货类型", combo = {"海外","香港","保税仓","美亚商城"})
    @NotEmpty(message = "交货类型不能为空")
    private String deliveryTypeString;

    public Integer getDeliveryType() {
        switch (deliveryTypeString) {
            case "海外":
                return 10;
            case "香港":
                return 20;
            case "保税仓":
                return 30;
            case "美亚商城":
                return 60;
            default:
                return 10;
        }
    }

    /**
     * 交货类型
     */
    @Excel(name = "*交货方式", combo = {"自提","送货入仓","运费实报实销"})
    @NotEmpty(message = "交货方式不能为空")
    private String deliveryModeString;

    public Integer getDeliveryMode() {
        switch (deliveryModeString) {
            case "自提":
                return 10;
            case "送货入仓":
                return 20;
            case "运费实报实销":
                return 30;
            default:
                return 10;
        }
    }

    /**
     * 交货类型
     */
    @Excel(name = "*贸易类型", combo = {"FOB", "CIF", "其他"})
    @NotEmpty(message = "贸易类型不能为空")
    private String tradeTypeString;

    public Integer getTradeType() {
        switch (deliveryTypeString) {
            case "FOB":
                return 10;
            case "CIF":
                return 20;
            case "其他":
                return 30;
            default:
                return 30;
        }
    }

    /**
     * 单箱/托规格
     */
    @Excel(name = "*单箱/托规格", prompt = "请填写正整数", cellType = Excel.ColumnType.NUMERIC)
    @NotNull(message = "单箱/托规格不能为空")
    private BigDecimal specsUnit;
    /**
     * 最小采购量
     */
    @Excel(name = "*最小采购数量", prompt = "请填写正整数", cellType = Excel.ColumnType.NUMERIC)
    @NotNull(message = "最小采购量不能为空")
    private BigDecimal minPurQty;

    /**
     * 发货地址
     */
    @Excel(name = "*发货地址")
    @NotEmpty(message = "发货地址不能为空")
    private String deliveryAddr;

}
